package com.cy.cykh.app.view.activity

import android.arch.lifecycle.Observer
import android.view.View
import com.cy.cykh.app.cdyapp.R
import com.cy.cykh.app.view.base.BaseActivity
import com.cy.cykh.app.viewmodel.OtherViewModel
import kotlinx.android.synthetic.main.activity_other.*
import kotlinx.android.synthetic.main.view_toolbar.*
import android.arch.lifecycle.ViewModelProviders
import android.util.Log
import com.cy.cykh.app.util.dismissProgress
import com.cy.cykh.app.util.showProgress

/**
 * @author Administrator
 * @FileName
 * @date 2019/1/4 16:08
 */
class OtherActivity : BaseActivity(){


    private lateinit var otherModel: OtherViewModel
    override fun getContentViewID(): Int {

        return R.layout.activity_other
    }

    override fun initView() {
        initToolbar(toolbar,"动画加载")
        showProgress()
        otherModel = ViewModelProviders.of(this).get(OtherViewModel::class.java)
        otherModel.loadPublishedDate()
        otherModel.loadStatusLiveData.observe(this, Observer { loadStatus ->
            loadStatus?.let {
                Log.e("dddd",it)
                tv.text=it
                dismissProgress()

            }
        })

    }

    override fun onDestroy() {
        super.onDestroy()
    }
}